﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace IBS
{
    public class IBSImportFileFormat
    {
        public Int64 SITEIBSCODE { get; set; }      
        public String IP { get; set; }
        public String DOC_NUMBER { get; set; }
        public Int32 COMPANY_KEY { get; set; }
        public DateTime DOC_DATE { get; set; }
        public Int64 ITEM_KEY { get; set; }
        public Int64 QTY { get; set; }
        public Double ACTUAL_PRICE { get; set; }


        public void SerializeToFile(string filePath)
        {
            String spaceCHR = " ";
            StringBuilder resultString = new StringBuilder();
            resultString.Append(String.Concat(ITEM_KEY.ToString(), spaceCHR));
            resultString.Append(String.Concat(QTY.ToString(), spaceCHR));
            resultString.Append(ACTUAL_PRICE.ToString().Replace(".", ","));
            File.AppendAllText(filePath, resultString.ToString() + "\r\n");
        }
    }
}
